//! @Author: DengLibin
//! @Date: Create in 2023-11-07 11:11:38
//! @Description: 用户接口

use crate::{
    entity::User,
    global::{AppState, Resdata},
    service::user_service,
};
use axum::{Extension, Json};
use std::sync::Arc;

/// @Author: DengLibin
/// @Date: Create in 2023-11-07 11:14:40
/// @Description: 用户列表
pub async fn list(Extension(state): Extension<Arc<AppState>>) -> Json<Resdata<Vec<User>>> {
    let arc = state.clone();
    let r = user_service::list(arc).await;

    Json(Resdata::ok_result(r))
}
